#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int n,m,a[100010],c[100010];
int main()
{
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    scanf("%d %d",&n,&m);
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    for(int i=1;i<=m;i++) scanf("%d",&c[i]);
    int k=0;
    while(pow(2,k)>=n) k++;
    fclose(stdin);
    fclose(stdout);
    return 0;
}